package LCR_code;

/**
 * @author blh
 * @date 2024年08月26日 16:20
 */
public class LCR_131_826 {
    public static int cuttingBamboo(int bamboo_len) {
        int[] dp = new int[bamboo_len + 1];
        dp[1] = 1;
        for (int i = 2; i <= bamboo_len; i++) {
            for (int j = 1; j < i; j++) {
                int temp = Math.max(dp[j] * (i - j), dp[j] * dp[i - j]);
                int temp2 = Math.max(temp, j * (i - j));
                dp[i] = Math.max(temp2, dp[i]);
            }
        }
        return dp[bamboo_len];
    }

    public static void main(String[] args) {
        System.out.println(cuttingBamboo(6));
    }
}
